package com.boot.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boot.bean.TestUser;
import com.boot.bean.User;
import com.boot.dao.IUserDao;
import com.boot.dao.TestUserDao;
import com.boot.mapper.UserMapper;
import com.boot.service.TestUserService;

@Service
public class TestUserServiceImpl implements TestUserService{

	@Autowired
	private TestUserDao testUserDao;
	
	@Autowired 
	private UserMapper userMapper; // 注入代理对象

	@Override
	public TestUser saveUser(TestUser testUser) {
		
		TestUser user = testUserDao.save(testUser);
		
		return user;
	}

	@Override
	public List<User> getUsers() {
		List<User> findAll = userMapper.findAll();//testUserDao.findAll();
		
		return findAll;
	}
	
	
}
